﻿<UserControl x:Class="ExchangeTracker.Presentation.Common.LayoutItem"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:common="clr-namespace:ExchangeTracker.Presentation.Common"
             Margin="3"
             >
    <UserControl.ContentTemplate>
        <DataTemplate>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" SharedSizeGroup="Label"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock VerticalAlignment="Center" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type common:LayoutItem},Mode=FindAncestor},Path=Label}" Margin="3"/>
                <ContentControl Content="{Binding}" Grid.Column="1" VerticalContentAlignment="Center" HorizontalContentAlignment="Stretch"/>
            </Grid>
        </DataTemplate>
    </UserControl.ContentTemplate>
</UserControl>
